package com.wc.AlgoOJ_homework.ALOJ模块测试Ⅲ.A_积木画;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/5/19 12:48
 * @description http://43.138.190.70:8888/p/LQ1316?tid=66444686c0c2f98e569f403b
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 10000000, P = 1000000007;
    static long[][] f = new long[N][3];
    static int n;

    public static void main(String[] args) {
        n = sc.nextInt();
        f[1][0] = 1;
        f[2][0] = 2;
        f[2][1] = 1;
        f[2][2] = 1;
        for (int i = 3; i <= n; i++) {
            f[i][0] = (f[i - 1][0] + f[i - 2][0] % P) % P;
            f[i][0] = (f[i][0] + (f[i - 1][1] + f[i - 1][2]) % P) % P;
            f[i][1] = (f[i - 1][2] + f[i - 2][0]) % P;
            f[i][2] = (f[i - 1][1] + f[i - 2][0]) % P;
        }
        out.println(f[n][0]);
        out.flush();
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
